/***************************************************************************************************
  Copyright(C)   2011-2013
  All rights reserved.
  File Name: serialctlthread.h

  Description: 串口管理线程类，用来运行串口管理模块　serialctl


  ***************************************************************************************************/

#ifndef SERIALCTLTHREAD_H
#define SERIALCTLTHREAD_H

#include <QThread>

#include "serialctl.h"

class SerialCtlThread : public QThread
{
    Q_OBJECT
public:
    explicit SerialCtlThread(QObject *parent = 0);
    ~SerialCtlThread();

    void tisSelfTest();
private:
    void run();

private:
    SerialCtl *m_serialCtrl;

signals:
    //同tcpserver相连接的信号
    void receGetLcdStatus();                                               //申请获得LCD的状态
    void receLcdBackLightCtl(const qint8 cmd, const QList<quint16>& panelIDList);
    void receQueryVideoStatus(const qint8 cmd);
    void receSlcdCollectState(const QList<PanelInfoStruct>& infoList);
    void receChangeBriLv(const LcdSettingStruct& settingStruct);            //收到改变LCD 亮度等级信息
    void receChangeLcdBright(const qint16 brightness, const QList<quint16>& panelIDList);
    void getLcdSetting();
    //配置已经进行更新，必须重新读取配置
    void updateConfig();
    void sendBrihgtness(const qint16 brightness);

    //同serialctl相连接的信号
    void lcdAnswerStatus(QList<LCDSTATUS> status);
    void sendSensorData(const qint16);
    void sendLcdSetting(const LcdSettingStruct& lcdSettings);
    void sendLcdState(const QMap<qint16, qint8>& lcdState);
    void openLcdSPErr();
    void sendSetLcdSettingStatus(const qint8 state);
    void sendSetLcdTraValueStatus(const qint8 state);
    void sendBackLightStatus(qint8 status);
    //发送视频状态,isSendToTis是否要回复给TIS,true是要，false不用
    void sendVideoStatus(const QList<LCDSTATUS>& status, const bool isSendToTis);
    void tisSelfTestSignal();

};

#endif // SERIALCTLTHREAD_H
